import axios from 'axios';

const host = 'http://backend-api-02.newbee.ltd/manage-api/v1'



const instance = axios.create({
    // baseURL: 基础路径
    baseURL: host + '',
    // [defaults.headers['X-Requested-With']] : 'XMLHttpRequest',
    // [defaults.headers['token']]: localGet('token') || ''
})

// instance.interceptors.request.use(function (config) {
//     // Do something before request is sent
//     let userInfo = localStorage.getItem('userInfo')
//     try {
//         userInfo = JSON.parse(userInfo) || {}
//     } catch (err) {
//         userInfo = {}
//     }
//     if (userInfo.authorization) {
//         config.headers.Authorization = userInfo.authorization

//     }
//     return config;
// }, function (error) {
//     // Do something with request error
//     return Promise.reject(error);
// });
// instance.host = host


export default instance
